{include file="common/head"}
<head>
<title>产品编辑</title>
</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;"  >
    <h2>规格编辑</h2>
    <form method="post" enctype="multipart/form-data" action="/index.php/goods/spec_edit">

      <input type="hidden" name="id" id="id" value="{$data.id}" />
      <input type="hidden" name="save" id="save" value="1" />
      <div class="mb-3 mt-3">
        <lable for="name" class="form-label">名称(spec name):</label>
        <input type="text" class="form-control" id="name" name="name" value="{$data.name}" placeholder="name" />
      </div>
      <div class="mb-3 mt-3">
        <lable for="desc" class="form-label">规格说明(Name2):</label>
        <input type="text" class="form-control" id="desc" name="desc" value="{$data.desc}" placeholder="desc" />
      </div>      
      <div class="mb-3">
        <label for="price" class="form-label">价格(Price):</label>
        <input type="text" class="form-control" id="price" name="price" value="{$data.price}" placeholder="" />
      </div>
      <div class="mb-3">
        <label for="storage" class="form-label">库存(storage):</label>
        <input type="number" class="form-control" id="storage" name="storage" value="{$data.storage}" placeholder="" />
      </div>      
      <div class="mb-3">
        <label for="status" class="form-label">是否启用(Using):</label>
          <input type="radio" class="form-check-input" id="radio1" name="status" value="1" {if $data.status==1} checked {/if}/> 
          <label class="form-check-label" for="radio1">上架(Using)</label>
          <input type="radio" class="form-check-input" id="radio2" name="status" value="2" {if $data.status==2} checked {/if}/>
          <label class="form-check-label" for="radio2">下架(Stoped)</label>
       </div>
      <div class="mb-3">
        <img src="{$data.imgs}" style="width: 60px;"/><br />
        <label for="file" class="form-label">上传图片(Image):</label>
        <input type="file"  name="file" /> <br> 
      </div>       
       
      <button  type="button" class="btn btn-primary" onclick="doSave()">保存(Save)</button>

    </form>
    </div>

<script type="text/javascript">
  function doSave(){
    $('form').submit();
  }
</script>


</body>
</html>
